﻿using LanguageControlBase.Wpf;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Controls;

namespace FinalTestMachine.View.MainUnits
{
    internal class UserControlMode
    {
        public UserControl _userControl { get; }
        public LanTextBlock Name { get; }
        public double With { get; }

        public UserControlMode(UserControl control, LanTextBlock name)
        {
            _userControl = control;
            Name = name;
            With = _userControl.MaxWidth;
        }
    }
    class Unit_FunsViewHelper
    {
        public static ObservableCollection<UserControlMode> demoViewModels = new ObservableCollection<UserControlMode>();
        public static Unit_FunsBaseSetting unit_FunsBaseSetting = new Unit_FunsBaseSetting();
        public static Unit_FunsBaseSetting unit_FunsBaseSetting2 = new Unit_FunsBaseSetting();
        public static Unit_FunsBaseSetting unit_FunsBaseSetting3 = new Unit_FunsBaseSetting();
        static Unit_FunsViewHelper()
        {
            demoViewModels.Add(new UserControlMode(new Unit_SiteStationSetting(), new LanTextBlock
            {
                LanText = "站位设置"
            }));
            demoViewModels.Add(new UserControlMode(unit_FunsBaseSetting, new LanTextBlock
            {
                LanText = "通用设置"
            }));
            demoViewModels.Add(new UserControlMode(unit_FunsBaseSetting2, new LanTextBlock
            {
                LanText = "治具设置"
            }));
            demoViewModels.Add(new UserControlMode(unit_FunsBaseSetting3,new LanTextBlock
            { 
                LanText = "光管设置" 
            }));
        }

        public static void Reflush()
        {
            unit_FunsBaseSetting.SetFunsSelections(Funs.FunCommSelection.Cur);
            unit_FunsBaseSetting2.SetFunsSelections(Funs.FunSocketSettings.Cur);
            unit_FunsBaseSetting3.SetFunsSelections(Funs.FunLightPipeSettings.Cur);
        }
    }
}
